﻿using UnityEngine;
using System.Collections.Generic;
using System;

namespace GameCore
{
    //因为值类型泛型的生成在IL2CPP下会有JIT异常，所以值类型必须要注册
    public partial class LuaBehaviour : MonoBehaviour
    {
        private static readonly Dictionary<Type, Type> WRAP_TYPE_DICT = new Dictionary<Type, Type>()
        {
            {typeof(Int32), typeof(ObjWrap<Int32>)},
            {typeof(Int64), typeof(ObjWrap<Int64>)},
            {typeof(Single), typeof(ObjWrap<Single>)},
            {typeof(Double), typeof(ObjWrap<Double>)},
            {typeof(Boolean), typeof(ObjWrap<Boolean>)},
            {typeof(string), typeof(ObjWrap<string>)},
            {typeof(Vector2), typeof(ObjWrap<Vector2>)},
            {typeof(Vector3), typeof(ObjWrap<Vector3>)},
            {typeof(Vector4), typeof(ObjWrap<Vector4>)},
            {typeof(Color), typeof(ObjWrap<Color>)},
            {typeof(Rect), typeof(ObjWrap<Rect>)},
            {typeof(Bounds), typeof(ObjWrap<Bounds>)},

            {typeof(List<int>), typeof(ObjWrap<List<int>>)},
            {typeof(List<string>), typeof(ObjWrap<List<string>>)},
            {typeof(List<Vector3>), typeof(ObjWrap<List<Vector3>>)},
            {typeof(List<Color>), typeof(ObjWrap<List<Color>>)},
            {typeof(ElementType), typeof(ObjWrap<ElementType>)},
            {typeof(ToolType), typeof(ObjWrap<ToolType>)},

        };
    }
}
